package com.xplay.xpocker.room.mahjong.dto;

import lombok.Data;

@Data
public class ScoreInfo {
    private int multiple;
    private String name;


    public int getTotalScore(int multiple) {
        int basisScore = 12, totalScore = 0;
        if (multiple == 0) {
            totalScore = 2;
        } else {
            totalScore = calculateScore(basisScore, multiple);
        }
        return totalScore;
    }


    public int getTotalScore() {
        int basisScore = 12, totalScore = 0;
        if (multiple == 0) {
            totalScore = 2;
        } else {
            totalScore = calculateScore(basisScore, multiple);
        }
        return totalScore;
    }

    private int calculateScore(int baseScore, int multiplier) {
        int result = baseScore;
        for (int i = 0; i < multiplier - 1; i++) {
            result *= 2;
        }
        return result;
    }

    public ScoreInfo() {
    }

    public ScoreInfo(int multiple, String name) {
        this.multiple = multiple;
        this.name = name;
    }
}
